package com.cdn.allmobilestore.activity;

import com.cdn.allmobilestore.R;
import com.cdn.allmobilestore.R.layout;
import com.cdn.allmobilestore.R.menu;
import com.cdn.allmobilestore.ui.BaseFragment;
import com.cdn.allmobilestore.ui.DetailFragment;
import com.cdn.allmobilestore.ui.LocalAppFragment;
import com.cdn.allmobilestore.ui.PromotionFragment;
import com.cdn.allmobilestore.ui.SearchFragment;
import com.cdn.allmobilestore.ui.TutorialFragment;
import com.cdn.allmobilestore.ulti.Constant;
import com.cdn.allmobilestore.ulti.Log;

import android.os.Bundle;
import android.app.Activity;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.Menu;

public class TutorialActivity extends BaseActivity {

	@Override
	protected Fragment newFragmentByTag(String tag)
	  {	 
		
		Fragment localappFragment = null;
	    if (TextUtils.equals(tag, Constant.FRAGMENT_TAG_TUTORIAL))
	    {
	    	Log.v("create Fragment");
	        localappFragment = new TutorialFragment(true,Constant.TUTORIAL_URL+"?tutorial=1");	       
	    }
		return localappFragment;
	    
	  }
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		if(null == savedInstanceState)
		{
			super.setDisplayShowCustomEnabled(false);
			showFragment(Constant.FRAGMENT_TAG_TUTORIAL, savedInstanceState, false);
			setHomeButtonEnable(true);
			setBarTitle(getString(R.string.localapp_tutorial));
		}
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.search, menu);
		return true;
	}

}
